<?php

require_once ("./BL.php");
require_once ("../Frameworks/Objects/user.php");
require_once ("../Frameworks/Objects/category.php");
require_once ("../Frameworks/Objects/entity.php");
require_once ("../Frameworks/Objects/attribute.php");

//require_once ("../Frameworks/Objects/category.php/");
echo "Commencing test <br>" ;


echo "Getting all the private categories... <br>";


$private = BL_GetPrivateCategories();

print_r($private);

$retval = BL_sendPassword("dimitris1");
echo "retval in BL send Password is " . $retval;
//$user = BL_getUserData();
die;
//HAS BUG Houses category not found...
/*
$search_results = array();
$search_results =  BL_simpleSearch( 30, "Houses");
print_r($search_results[0]);
print_r($search_results[1]);
*/



//Register a user
$test_user = new User();

$test_user->SetUsername("testusr2");
$test_user->SetPassword("testpass");
$test_user->SetEmail("test2@test.com");
$test_user->SetName("TestName");
$test_user->SetSurname("TestSurname");

$retval = BL_RegisterUser($test_user);

echo "Regsitration retrun value was " . $retval . "<br>";



//Activate him
$retval = BL_activateUser($test_user->GetName());

echo "Activation retrun value was " . $retval . "<br>";


//Log him in
$retval = BL_UserLogin($test_user->GetUsername(), $test_user->GetPassword() );

echo "Login retrun value was " . $retval . "<br>";



$ent = new Entity();


$attr = new Attribute();


$testCat = new Category();

$test_cat->Setname("TestCat1");
//$test_cat->
echo "End test";



?>
